import request from "@/utils/request";

export default {
    // 获取课程相关信息
    getCourseRelatedInfo(courseId) {
        return request({
            url:  '/system/course/' + courseId,
            method: 'get'
        })
    },
    //获取课程列表
    getCourseList(){
        return request({
            url: '​/system​/course​/list',
            method: 'get'
        })
    },
    //查询课程章节树
    getCourseChapterTree(){
        return request({
            url: '/system/course/chapter/tree',
            method: 'get'
        })
    },
    //获取课程章节详细信息
    getCourseChapterDetail(ccId){
        return request({
            url: `/system/course/chapter/${ccId}`,
            method: 'get'
        })
    },
    //课外读物列表
    getBookList(){
        return request({
            url: '/system/reading/list',
            method: 'get'
        })
    },
    //课外读物详情
    getBookListDetail(readingId){
        return request({
            url: `​/system​/reading​/${readingId}`,
            method: 'get'
        })
    },

    //查询课程资源列表
    getProgramResources(){
        return request({
            url: '/system/course/resource/list',
            method: 'get'
        })
    },
    //查询课程资源详情数据
    getProgramResourcesDetail(crId){
        return request({
            url: `​/system​/course​/resource​/${crId}`,
            method: 'get'
        })
    },
    // 查询课程章节列表
treeChapter(query) {
    return request({
      url: '/system/course/chapter/tree',
      method: 'get',
      params: query
    })
  },
  //查询课程资源
getCourseResource(query) {
    return request({
      url: '/system/course/resource/list',
      method: 'get',
      params: query
    })
  },
  //下载资源
  downloadResource(crId){
    return request({
      url: `/system/course/resource/download/`+crId,
      method: 'get',
      responseType: 'blob'
    })
  },
  //一次性获取全部视频
  getAllVideo(){
    return request({
      url: '/system/course/resource/all',
      method: 'get'
    })
  }
}




